import request from "@/request/api";
/* 备品备件 */
// 新增
export function addEquipmentBackup(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/add",
    method: "post",
    data: data
  });
}
// 修改保存
export function updateEqBackup(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/update",
    method: "post",
    data: data
  });
}
// 提交
export function submitEqBackup(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/commit",
    method: "post",
    data: data
  });
}
// 删除
export function deleteEqBackup(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/delete",
    method: "post",
    data: data
  });
}
// 分页查询
export function serchEqBackup(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/serch",
    method: "get",
    params: data
  });
}
// 新分页查询
export function serchEqBackupNew(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/serchnew",
    method: "get",
    params: data
  });
}
// 获取详情
export function getDetails(id = "") {
  return request({
    url: "/eam-service-device/equipmentBackup/getById",
    method: "get",
    params: {
      id,
    },
  });
}

// 获取分类树结构
export function getTree(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/getTree",
    method: "get",
    params: data
  });
}
// 新增分类
export function insertClassify(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/insertClassify",
    method: "post",
    data: data
  });
}
// 修改分类
export function updateClassify(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/updateClassify",
    method: "post",
    data: data
  });
}
// 删除分类
export function deleteClassify(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/deleteClassify",
    method: "post",
    data: data
  });
}
// 导入
export function backupImport(classifyId,formData) {
  return request({
    url: "/eam-service-device/equipmentBackup/import",
    method: "post",
    params: {
      classifyId,
    },
    data: formData
  });
}
// 查询分类
export function getClassifyById(classifyid="") {
  return request({
    url: "/eam-service-device/equipmentBackup/getClassifyById",
    method: "get",
    params: {
      classifyid,
    },
  });
}
// 批量绑定设备
export function commitBindBatch(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/bindBatch",
    method: "post",
    data: data
  });
}
// 批量解绑设备
export function commitNoBindBatch(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/noBindBatch",
    method: "post",
    data: data
  });
}

// 获取分类
export function getTreeList(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/getTreeList",
    method: "get",
    params: data
  });
}
// 获取分类
export function changeStatusApi(data) {
  return request({
    url: "/eam-service-device/equipmentBackup/changeStatus",
    method: "get",
    params: data
  });
}